package com.local.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotEmpty;

import com.cz073586.tools.util.Tools;
import com.local.common.CommonContains;

@Entity
@Table(name = "local_pay_bill")
public class LocalPayBill
{
	
	private String exchangeUuid;
	
	private String payTypeInt;
	@NotEmpty
	@Length(min = 1, max = 32)
	@Column(name = "pay_bill_uuid")
	private String payBillUuid;
	
	@Column(name = "car_no")
	private String carNo;
	
	@Column(name = "pay_time")
	private Date payTime;
	
	@Column(name = "pay_type")
	private String payType;
	
	@Column(name = "price")
	private Double price;
	
	@Column(name = "version")
	private Double version;
	
	@Column(name = "park_in_uuid")
	private String parkInUuid;
	
	@Column(name = "actual_price")
	private Double actualPrice;
	
	@Column(name = "user_id")
	private String userId;
	
	@Column(name = "user_name")
	private String userName;
	
	@Column(name = "car_out_uuid")
	private String carOutUuid;
	
	@Column(name = "carIn_creat_at")
	private Date carinCreatAt;
	
	@Column(name = "carOut_carete_at")
	private Date caroutCareteAt;
	
	@Column(name = "stay_time_long")
	private String stayTimeLong;
	
	//支付类型----百事通         1:微信支付 2:支付宝支付 3:银行卡支付 4:余额支付 5:百度钱包支付

	@Column(name = "attr1")
	private String attr1;
	
	//支付类型中文描述----百事通
	@Column(name = "attr2")
	private String attr2;
	
	@Column(name = "attr3")
	private String attr3;
	
	public String getPayBillUuid()
	{
		return payBillUuid;
	}
	
	public void setPayBillUuid(String payBillUuid)
	{
		this.payBillUuid = payBillUuid == null ? null : payBillUuid.trim();
	}
	
	public String getCarNo()
	{
		return carNo;
	}
	
	public void setCarNo(String carNo)
	{
		this.carNo = carNo == null ? null : carNo.trim();
	}
	
	public Date getPayTime()
	{
		return payTime;
	}
	
	public void setPayTime(Date payTime)
	{
		this.payTime = payTime;
	}
	
	public String getPayType()
	{
		return payType;
	}
	
	public void setPayType(String payType)
	{
		this.payType = payType == null ? null : payType.trim();
	}
	
	public Double getPrice()
	{
		return price;
	}
	
	public void setPrice(Double price)
	{
		this.price = price;
	}
	
	public Double getVersion()
	{
		return version;
	}
	
	public void setVersion(Double version)
	{
		this.version = version;
	}
	
	public String getParkInUuid()
	{
		return parkInUuid;
	}
	
	public void setParkInUuid(String parkInUuid)
	{
		this.parkInUuid = parkInUuid == null ? null : parkInUuid.trim();
	}
	
	public Double getActualPrice()
	{
		return actualPrice;
	}
	
	public void setActualPrice(Double actualPrice)
	{
		this.actualPrice = actualPrice;
	}
	
	public String getUserId()
	{
		return userId;
	}
	
	public void setUserId(String userId)
	{
		this.userId = userId == null ? null : userId.trim();
	}
	
	public String getUserName()
	{
		return userName;
	}
	
	public void setUserName(String userName)
	{
		this.userName = userName == null ? null : userName.trim();
	}
	
	public String getCarOutUuid()
	{
		return carOutUuid;
	}
	
	public void setCarOutUuid(String carOutUuid)
	{
		this.carOutUuid = carOutUuid == null ? null : carOutUuid.trim();
	}
	
	public Date getCarinCreatAt()
	{
		return carinCreatAt;
	}
	
	public void setCarinCreatAt(Date carinCreatAt)
	{
		this.carinCreatAt = carinCreatAt;
	}
	
	public Date getCaroutCareteAt()
	{
		return caroutCareteAt;
	}
	
	public void setCaroutCareteAt(Date caroutCareteAt)
	{
		this.caroutCareteAt = caroutCareteAt;
	}
	
	public String getStayTimeLong()
	{
		return stayTimeLong;
	}
	
	public void setStayTimeLong(String stayTimeLong)
	{
		this.stayTimeLong = stayTimeLong == null ? null : stayTimeLong.trim();
	}
	
	public String getAttr1()
	{
		return attr1;
	}
	
	public void setAttr1(String attr1)
	{
		this.attr1 = attr1 == null ? null : attr1.trim();
	}
	
	public String getAttr2()
	{
		return attr2;
	}
	
	public void setAttr2(String attr2)
	{
		this.attr2 = attr2 == null ? null : attr2.trim();
	}
	
	public String getAttr3()
	{
		return attr3;
	}
	
	public void setAttr3(String attr3)
	{
		this.attr3 = attr3 == null ? null : attr3.trim();
	}
	
	public String getExchangeUuid()
	{
		return exchangeUuid;
	}
	
	public void setExchangeUuid(String exchangeUuid)
	{
		this.exchangeUuid = exchangeUuid;
	}
	
	public void setPayTypeInt(String payTypeInt)
	{
		this.payTypeInt = payTypeInt;
	}
	
	public String getPayTypeInt(String ss)
	{
		if (Tools.isEmpty(ss))
		{
			return CommonContains.PAY_TYPE_OTHER;
		}
		String type = "";
		switch (ss)
		{
		case "会员":
			type = CommonContains.PAY_TYPE_MEMBER;
			break;
		case "白名单":
			type = CommonContains.PAY_TYPE_WHITE;
			break;
		case "现金":
			type = CommonContains.PAY_TYPE_MONEY;
			break;
		case "移动支付":
			type = CommonContains.PAY_TYPE_ONLINE;
			break;
		case "自动扣费":
			type = CommonContains.PAY_TYPE_AUTO;
			break;
		case "抵用劵":
			type = CommonContains.PAY_TYPE_COUPON_CASH;
			break;
		case "百事通代金劵":
			type = CommonContains.PAY_TYPE_COUPON_VOUCHER;
			break;
		default:
			type = CommonContains.PAY_TYPE_OTHER;
			break;
		}
		return !Tools.isEmpty(type) ? type : CommonContains.PAY_TYPE_OTHER;
	}
	
}